# 导包
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
# 创建浏览器对象
driver = webdriver.Firefox()
# 打开注册页面
url = 'file:///C:/Users/TEACHER/Desktop/NSD2405/html/registerA.html'
driver.get(url)
# 通过NAME定位方式，定位用户名、密码、邮箱，并输入值
username = driver.find_element(By.NAME, 'userA')
username.send_keys('admin')
password = driver.find_element(By.NAME, 'passwordA')
password.send_keys('123456')
email = driver.find_element(By.NAME, 'emailA')
email.send_keys('123@qq.com')
# 通过CLASS定位方式，定位电话号码，并输入值
tel = driver.find_element(By.CLASS_NAME, 'telA')
tel.send_keys('18812345678')

# 停顿3秒钟，关闭浏览器驱动
sleep(3)
driver.quit()


